package com.xxx.service;
import java.util.List;
import java.util.Map;

import com.xxx.common.dto.Page;
import com.xxx.common.dto.Pagination;
import com.xxx.model.SysUserBasis;

public interface SysUserBasisService {

	/**
	 * 保存或者更新
	 * @param sysUserBasis
	 * @return
	 */
	public long saveOrUpdate(SysUserBasis sysUserBasis) throws Exception;
		
	/**
	 * 删除
	 * @param id
	 * @return
	 */
	public boolean delete(long id) throws Exception;
	
	/**
	 * 获取个数
	 * @param whereMap
	 * @return
	 * @throws Exception 
	 */
	public int getCount(Map<String, Object> whereMap) throws Exception;
	
	/**
	 * 根据logincode获取
	 * @param id
	 * @return
	 */
	public SysUserBasis getEntityByLoginCode(String logincode) throws Exception;
	
	/**
	 * 根据phone获取
	 * @param id
	 * @return
	 */
	public SysUserBasis getEntityByPhone(String phone) throws Exception;
	
	/**
	 * 根据id获取
	 * @param id
	 * @return
	 */
	public SysUserBasis getEntity(long id) throws Exception;
	
	
	/**
	 * 用户login 
	 * @param account 用户名/手机号码
	 * @param pwd 密码
	 * @return 登录成功返回 SysUserBasis 登录失败 返回  null
	 * @throws Exception
	 */
	public SysUserBasis login(String account,String pwd) throws Exception;
	
	/**
	 * 获取所有 
	 * @param whereMap 查询条件
	 * @return
	 */
	public List<SysUserBasis> getList(Map<String, Object> whereMap) throws Exception;
	
	/**
	 * 获取集合,带分页条件
	 * @param whereMap 查询条件
	 * @param pagination 分页,排序
	 * @return
	 */
	public List<SysUserBasis> getList(Map<String, Object> whereMap,Pagination pagination) throws Exception;
	
	/**
	 * 获取集合,带分页参数
	 * @param whereMap 查询条件
	 * @param pagination 分页,排序
	 * @return
	 */
	public Page<SysUserBasis> getPage(Map<String, Object> whereMap,Pagination pagination) throws Exception;
	
	/**
	 * 重置密码
	 * @param id
	 * @param pwd
	 * @return
	 */
	public boolean resetPwd(long id,String pwd) throws Exception;
}
